/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package personal.obj;

/**
 *
 * @author PHATNBSE61057
 */
public class Book {

    private String bookID;
    private String categoryID;
    private String bookName;
    private String bookLink;
    private String bookThumb;
    private String bookImg;
    private String bookPrice;
    private String bookPages;
    private String bookFormat;
    private String bookAuthor;
    private String bookPublishedDate;
    private String bookISBN;
    private String bookDetailedEdition;
    private String bookDescription;

    public Book() {
    }

    public Book(String categoryID, String bookName, String bookLink,
            String bookThumb, String bookImg, String bookPrice, String bookPages,
            String bookFormat, String bookAuthor, String bookPublishedDate,
            String bookISBN, String bookDetailedEdition, String bookDescription,
            String webPage) {
        this.categoryID = categoryID;
        this.bookName = bookName;
        if (!bookLink.contains("http")) {
            this.bookLink = webPage + bookLink;
        } else {
            this.bookLink = bookLink;
        }
        if (!bookThumb.contains("http")) {
            this.bookThumb = webPage + bookThumb;
        } else {
            this.bookThumb = bookThumb;
        }
        if (!bookImg.contains("http")) {
            this.bookImg = webPage + bookImg;
        } else {
            this.bookImg = bookImg;
        }
        this.bookPrice = bookPrice;
        this.bookPages = bookPages;
        this.bookFormat = bookFormat;
        this.bookAuthor = bookAuthor;
        this.bookPublishedDate = bookPublishedDate;
        this.bookISBN = bookISBN;
        this.bookDetailedEdition = bookDetailedEdition;
        this.bookDescription = bookDescription;
    }

    public Book(String bookID, String categoryID, String bookName, String bookLink,
            String bookThumb, String bookImg, String bookPrice, String bookPages,
            String bookFormat, String bookAuthor, String bookPublishedDate,
            String bookISBN, String bookDetailedEdition, String bookDescription,
            String webPage) {
        this.bookID = bookID;
        this.categoryID = categoryID;
        this.bookName = bookName;
        if (!bookLink.contains("http")) {
            this.bookLink = webPage + bookLink;
        } else {
            this.bookLink = bookLink;
        }
        if (!bookThumb.contains("http")) {
            this.bookThumb = webPage + bookThumb;
        } else {
            this.bookThumb = bookThumb;
        }
        if (!bookImg.contains("http")) {
            this.bookImg = webPage + bookImg;
        } else {
            this.bookImg = bookImg;
        }
        this.bookPrice = bookPrice;
        this.bookPages = bookPages;
        this.bookFormat = bookFormat;
        this.bookAuthor = bookAuthor;
        this.bookPublishedDate = bookPublishedDate;
        this.bookISBN = bookISBN;
        this.bookDetailedEdition = bookDetailedEdition;
        this.bookDescription = bookDescription;
    }

    @Override
    public String toString() {
        String format = "Name: " + getBookName() + " Price: " + getBookPrice()
                + " Format: " + getBookFormat() + "\nLink: " + getBookLink();
        return format;
    }

    /**
     * @return the bookID
     */
    public String getBookID() {
        return bookID;
    }

    /**
     * @param bookID the bookID to set
     */
    public void setBookID(String bookID) {
        this.bookID = bookID;
    }

    /**
     * @return the categoryID
     */
    public String getCategoryID() {
        return categoryID;
    }

    /**
     * @param categoryID the categoryID to set
     */
    public void setCategoryID(String categoryID) {
        this.categoryID = categoryID;
    }

    /**
     * @return the bookName
     */
    public String getBookName() {
        return bookName;
    }

    /**
     * @param bookName the bookName to set
     */
    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    /**
     * @return the bookLink
     */
    public String getBookLink() {
        return bookLink;
    }

    /**
     * @param bookLink the bookLink to set
     */
    public void setBookLink(String bookLink) {
        this.bookLink = bookLink;
    }

    /**
     * @return the bookThumb
     */
    public String getBookThumb() {
        return bookThumb;
    }

    /**
     * @param bookThumb the bookThumb to set
     */
    public void setBookThumb(String bookThumb) {
        this.bookThumb = bookThumb;
    }

    /**
     * @return the bookImg
     */
    public String getBookImg() {
        return bookImg;
    }

    /**
     * @param bookImg the bookImg to set
     */
    public void setBookImg(String bookImg) {
        this.bookImg = bookImg;
    }

    /**
     * @return the bookPrice
     */
    public String getBookPrice() {
        return bookPrice;
    }

    /**
     * @param bookPrice the bookPrice to set
     */
    public void setBookPrice(String bookPrice) {
        this.bookPrice = bookPrice;
    }

    /**
     * @return the bookPages
     */
    public String getBookPages() {
        return bookPages;
    }

    /**
     * @param bookPages the bookPages to set
     */
    public void setBookPages(String bookPages) {
        this.bookPages = bookPages;
    }

    /**
     * @return the bookFormat
     */
    public String getBookFormat() {
        return bookFormat;
    }

    /**
     * @param bookFormat the bookFormat to set
     */
    public void setBookFormat(String bookFormat) {
        this.bookFormat = bookFormat;
    }

    /**
     * @return the bookAuthor
     */
    public String getBookAuthor() {
        return bookAuthor;
    }

    /**
     * @param bookAuthor the bookAuthor to set
     */
    public void setBookAuthor(String bookAuthor) {
        this.bookAuthor = bookAuthor;
    }

    /**
     * @return the bookPublishedDate
     */
    public String getBookPublishedDate() {
        return bookPublishedDate;
    }

    /**
     * @param bookPublishedDate the bookPublishedDate to set
     */
    public void setBookPublishedDate(String bookPublishedDate) {
        this.bookPublishedDate = bookPublishedDate;
    }

    /**
     * @return the bookISBN
     */
    public String getBookISBN() {
        return bookISBN;
    }

    /**
     * @param bookISBN the bookISBN to set
     */
    public void setBookISBN(String bookISBN) {
        this.bookISBN = bookISBN;
    }

    /**
     * @return the bookDetailedEdition
     */
    public String getBookDetailedEdition() {
        return bookDetailedEdition;
    }

    /**
     * @param bookDetailedEdition the bookDetailedEdition to set
     */
    public void setBookDetailedEdition(String bookDetailedEdition) {
        this.bookDetailedEdition = bookDetailedEdition;
    }

    /**
     * @return the bookDescription
     */
    public String getBookDescription() {
        return bookDescription;
    }

    /**
     * @param bookDescription the bookDescription to set
     */
    public void setBookDescription(String bookDescription) {
        this.bookDescription = bookDescription;
    }

}
